//
//  VideoDetailCellTableViewCell.m
//  MIDI
//
//  Created by E.M.Game on 15/9/11.
//  Copyright (c) 2015年 QXSX. All rights reserved.
//

#import "VideoDetailCellTableViewCell.h"
#import "CommFunc.h"

@interface VideoDetailCellTableViewCell()

@end

@implementation VideoDetailCellTableViewCell

- (void)awakeFromNib
{
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    //[super setSelected:selected animated:animated];
}

+(id)loadFromNib
{
    NSString *nibName = NSStringFromClass([self class]);
    return [[[NSBundle mainBundle] loadNibNamed:nibName owner:nil options:nil] firstObject];

}

-(int)getHeight
{
    int titleheight = [CommFunc sizeWithString:self.videoTitle.text
                        font:[UIFont fontWithName:@"Hiragino Sans GB" size:15]
                         max:CGSizeMake(self.videoTitle.frame.size.width, MAXFLOAT)].height;
    
    int height = [CommFunc sizeWithString:self.videoDescLabel.text
                                     font:[UIFont fontWithName:@"Hiragino Sans GB" size:12]
                                      max:CGSizeMake(self.videoDescLabel.frame.size.width, MAXFLOAT)].height;
    
    if (height <= 0)
        return 24;
    else
    {
        height = self.videoTitle.frame.origin.y + titleheight + 20 +
                    self.videoDescLabel.frame.origin.y + height + 36;
//        return height;
        
        return 106;
    }
    
    return 0;
}


@end












